class BootStrap {
	def authenticateService
     def init = { servletContext ->
	 
	 //Adding Roles
	def roleAdmin = new Role(authority:'ROLE_ADMIN', description:'App admin').save()
	def roleUser  = new Role(authority:'ROLE_USER', description:'App user').save()
	 
	 
	 //Adding Users
	def userGod = new User(username:'god',
	userRealName:'god almighty',
	enabled: true,
	emailShow: true,
	email: 'god@grailsapp.com',
	passwd: authenticateService.encodePassword('god')).save()

	def userSlave = new User(username:'slave',
	userRealName:'poor slave',
	enabled: true,
	emailShow: true,
	email: 'slave@grailsapp.com',
	passwd: authenticateService.encodePassword('slave')).save()
	 
	 //create the requestmpa here - this is an example - notice how each action is secured
//	def secureUserEdit = new RequestMap(url: '/user/edit*', configAttribute:'ROLE_ADMIN').save()
//	def secureUserSave = new RequestMap(url: '/user/save*', configAttribute:'ROLE_ADMIN').save()

//	def secureRecrutee = new RequestMap(url: '/recrutee/**', configAttribute:'ROLE_USER').save()
 
	 //Note that here we associate users with their respective roles
	roleAdmin.addToPeople(userGod)
	roleUser.addToPeople(userGod)
	roleUser.addToPeople(userSlave)
     }
     def destroy = {
     }
} 